#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 19-5-30 下午6:50
# @Author  : Tom
# @Site    : 
# @File    : demo.py
# @Software: PyCharm
from fdfs_client.client import Fdfs_client

"""
自定义fastdfs客户段进行图片保存。
"""
if __name__ == '__main__':
    # 使用 shell 进入 Python交互环境
    # $ python   manage.py    shell
    # 1. 导入FastDFS客户端扩展

    # 2. 创建FastDFS客户端实例
    # client = Fdfs_client('client.conf')  # 注意这个路径，以当前的路径进行计算
    # 3. 调用FastDFS客户端上传文件方法
    # ret = client.upload_by_filename("/home/python/Desktop/1.jpg")
    # print(ret)
    print("+++++")
    pass
# 打印的内容为getting connection
# <fdfs_client.connection.Connection object at 0x7f9c627cfa58>
# <fdfs_client.fdfs_protol.Tracker_header object at 0x7f9c627cfa20>
# {'Group name': 'group1', 'Storage IP': '192.168.23.42', 'Status': 'Upload successed.',
# 'Remote file_id': 'group1/M00/00/00/wKgXKlzvtqaAWsCEAAF1bRpdB4A48.jpeg',
# 'Local file name': '/home/python/Desktop/kk.jpeg', 'Uploaded size': '93.00KB'}
